<template>
  <div id="app">
<!--    <router-view />-->
    <keep-alive>
      <!--router-view组件是一个 functional 组件，渲染路径匹配到的视图组件-->
      <router-view v-if="$route.meta.keepAlive == true"></router-view>
    </keep-alive>
    <!--不须要缓存组件-->
    <router-view v-if="$route.meta.keepAlive == false"></router-view>
  </div>
</template>
<script>
export default {
  name: 'App'
}
</script>
<style lang="scss"></style>
